/**
 * JSparrow - Une version numérique du jeu "Attention Pirates !" - Copyright (C) 2014 Black Pearl
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program. If
 * not, see <http://www.gnu.org/licenses/>.
 */
package App.Modele;

import java.awt.Point;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;

/**
 * Classe abstraite de gestion de la configuration du jeu.
 *
 * @author BlackPearl
 */
public abstract class Configuration {

	public final static ArrayList<Point> EmplacementsInterdits = new ArrayList<Point>(
			Arrays.asList(
							//x,y
					new Point(1,7),
					new Point(1,9),
					new Point(2,0),
					new Point(8,0),
					new Point(3,9),
					new Point(8,8)
			));

	public final static ArrayList<Point> EmplacementsRepaires = new ArrayList<Point>(
			Arrays.asList(
							//x,y
					new Point(4,0),
					new Point(6,0),
					new Point(8,3),
					new Point(6,4),
					new Point(4,6),
					new Point(8,6),
					new Point(0,8),
					new Point(2,8),
					new Point(5,9),
					new Point(7,9)
					)
			);

	public final static ArrayList<Repaire> ModelesRepaires = new ArrayList<Repaire>(
			Arrays.asList(
							// nbTresors,	nbPirates,	nbCanons,	nbCanonsFixes
					new Repaire(3,			2,			2,			0),
					new Repaire(5,			2,			2,			1),
					new Repaire(2,			1,			1,			0),
					new Repaire(4,			1,			3,			1),
					new Repaire(3,			1,			0,			2),
					new Repaire(2,			1,			2,			0),
					new Repaire(5,			1,			3,			2),
					new Repaire(5,			3,			0,			1),
					new Repaire(3,			2,			2,			0),
					new Repaire(4,			2,			0,			1)
			));

	public final static ArrayList<Point> ModeleAttaqueRepaire = new ArrayList<Point>(
			Arrays.asList(
					new Point(-1,-1),
					new Point(-1,+1),
					new Point(0,-2),
					new Point(0,+2),
					new Point(+1,-1),
					new Point(+1,+1)
			));
	public final static ArrayList<Point> EmplacementsPort = new ArrayList<Point>(
			Arrays.asList(
					new Point(0,0),
					new Point(0,2),
					new Point(1,1)
			));
	

    /**
     * Obtenir un entier aléatoire.
     * 
     * @param min nombre minimum
     * @param max nombre maximum
     * @return nombre aléatoire
     */
    public static int random(int min, int max) {
        long seed = System.nanoTime();
        Random rand = new Random(seed);
        return rand.nextInt((max - min) + 1) + min;
    }
}
